from openai import OpenAI
from globle import configs as cfg

# user should set `base_url="https://api.deepseek.com/beta"` to use this feature.
client = OpenAI(
    api_key=cfg.DEEPSEEK_API_KEY,
    base_url="https://api.deepseek.com/beta",
)

response = client.completions.create(
    model="deepseek-chat",  # 必填，模型名称
    prompt="什么是deepseek?",  # 必填，提示词
    temperature=2,  # 温度, 取值0~2, 简单理解是温度越高随机性越强
    max_tokens=120  # 返回的最大token数
)

print(response)
print(response.choices[0].text)
